# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-enchant
pkgver=3.2.2
pkgrel=4
pkgdesc="Spellchecking library for Python"
url="https://github.com/pyenchant/pyenchant"
arch="noarch"
license="LGPL-2.0-or-later"
depends="enchant2 python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest aspell-en"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pyenchant/pyenchant/archive/v$pkgver.tar.gz
	remove-first.patch
	"
builddir="$srcdir"/pyenchant-$pkgver

replaces="py-enchant" # Backwards compatibility
provides="py-enchant=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare

	# PWL was removed in Enchant2 2.5.0
	# https://github.com/pyenchant/pyenchant/issues/313
	rm tests/test_pwl.py
}

build() {
	python3 setup.py build
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

check() {
	python3 -m pytest
}

sha512sums="
42ab2e0cc38af4223ec0233c9e22cd151aa9bda5b56b7bd642e39e3a323ab3c034391123af5d3a5399551533ba1c1746abd6bc9ee2ab4c7879b9bf0ac91e056d  py3-enchant-3.2.2.tar.gz
fceb066520fdc7e720b8c9ea37fe3386e09a68d2b196bcc5ad6b1981c7952f36b0ad78bda36b8345f8c6434555bf363637e8c7a14d656d1a05f4dbea96c75408  remove-first.patch
"
